package com.axjy.auth.controller;

import com.axjy.auth.service.UserService;
import com.axjy.commons.vo.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
public class UserController {

    @Resource
    private UserService userService;


    @RequestMapping("/v/aa")
    public String aa(){
        return "aaaaaa";
    }

    @RequestMapping("/p/bb")
    public String bb(){
        return "bbbbbb";
    }

    @RequestMapping("/auth/login")
    public Result login(String phone,String password){

        try{
           Map map=  userService.login(phone,password);
            return Result.success(map);
        }catch (Exception ex){
            return Result.fail(ex.getMessage());
        }


    }


}
